{{define "title"}}{{.user.Username}}的个人首页 {{end}}
{{define "content"}}
<div class="row banner">
</div>
<div class="row">
	<div class="col-lg-9 col-md-8 col-sm-7">
		<ol class="breadcrumb">
			<li><a href="/">首页</a></li>
			<li><a href="/users">会员</a></li>
			<li class="active">{{if .me.Uid}}{{if eq .me.Username .user.Username}}我的{{else}}{{.user.Username}}的{{end}}{{else}}{{.user.Username}}的{{end}}信息</li>
		</ol>
		<div class="box_white">
			<div class="userinfo">
				<div class="pull-right">
					<a href="/user/{{.user.Username}}" title="{{.user.Username}}"><img alt="{{.user.Username}}" src="{{gravatar .user.Avatar .user.Email 80 .is_https}}" width="80px" height="80px" class="img-rounded{{if not .user.IsOnline}} gray{{end}}">
						{{if .user.IsVip}}
						<span class="user-prosign"> &#9733 VIP</span>
						{{end}}
						</a>
					{{if .me.Username}}
					{{if ne .user.Username .me.Username}}
					<a class="btn btn-success btn-sm" href="/favorites/{{.user.Username}}">TA的收藏</a>
					<a class="btn btn-default btn-sm" href="/message/send?username={{.user.Username}}">发送消息</a>
					{{else}}
					<a class="btn btn-success btn-sm" href="/favorites/{{.user.Username}}">我的收藏</a>
					<a class="btn btn-default btn-sm" href="/account/edit">编辑信息</a>
					{{end}}
					{{else}}
					<a class="btn btn-success btn-sm" href="/favorites/{{.user.Username}}">TA的收藏</a>
					{{end}}
				</div>
				<span class="label label-default role">{{range .user.Rolenames}}{{.}} {{end}}</span>
				<ul class="list-unstyled">
					<li>
						<label>&nbsp;</label>
						<span class="title">第 {{.user.Uid}} 位会员</span>
					</li>
					<li>
						<label>ID:</label>
						<strong class="fn">{{.user.Username}}</strong>
					</li>
					{{if .user.Name}}
					<li>
						<label>名字:</label>
						<span>{{.user.Name}}</span>
					</li>
					{{end}}
					{{if .user.Open}}
					<li>
						<label>Email:</label>
						<span><a href="mailto:{{.user.Email}}">{{.user.Email}}</a></span>
					</li>
					{{end}}
					<li>
						<label>注册时间:</label>
						<span>{{.user.Ctime}}</span>
					</li>
					{{if gt .user.Weight 0}}
					<li>
						<label>今日活跃度排名:</label>
						<span><a href="/top/dau">{{.user.Weight}}</a></span>
					</li>
					{{end}}
					<li>
						<label>是否在线:</label>
						{{if .user.IsOnline}}
						<span class="line-state online">Online</span>
						{{else}}
						<span class="line-state offline">Offline</span>
						{{end}}
					</li>
					<li>
						<label>财富:</label>
						<span class="balance_area">
						{{if .user.Gold}}
						{{.user.Gold}} <img src="/static/img/gold_48.png" alt="" width="16px">
						{{end}}
						{{if .user.Silver}}
						{{.user.Silver}} <img src="/static/img/silver_48.png" alt="" width="16px">
						{{end}}
						{{.user.Copper}} <img src="/static/img/copper_48.png" alt="" width="16px">
						</span>
					</li>
				</ul>
			</div>
		</div>
		<div class="sep20"></div>
		<div class="box_white recent recent-topics">
			<div>
				<div class="pull-right title"><a href="/user/{{.user.Username}}/topics">更多>></a></div><h2 class="title">最近发布的主题</h2>
			</div>
			<ul class="list-unstyled">
				{{range .topics}}
				<li>
					<span class="node"><a href="/topics/node/{{.Nid}}" class="node">{{.Node}}</a></span>
					<a href="/topics/{{.Tid}}" title="{{.Title}}">{{substring .Title 60 "..."}}</a>
					<span class="info">at <abbr class="timeago" title="{{.Ctime}}"></abbr></span>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
		<div class="sep20"></div>
		<div class="box_white recent recent-topics">
			<div>
				<div class="pull-right title"><a href="/user/{{.user.Username}}/articles">更多>></a></div><h2 class="title">最近发布的文章</h2>
			</div>
			<ul class="list-unstyled">
				{{range .articles}}
				<li>
					<a href="/articles/{{.Id}}" title="{{.Title}}">{{substring .Title 60 "..."}}</a>
					<span class="info">at <abbr class="timeago" title="{{.Ctime}}"></abbr></span>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
		<div class="sep20"></div>
		<div class="box_white recent recent-topics">
			<div>
				<div class="pull-right title"><a href="/user/{{.user.Username}}/resources">更多>></a></div><h2 class="title">最近分享的资源</h2>
			</div>
			<ul class="list-unstyled">
				{{range .resources}}
				<li>
					<span class="node"><a href="/resources/cat/{{.Catid}}" class="node">{{.CatName}}</a></span>
					<a href="/resources/{{.Id}}" title="{{.Title}}">{{substring .Title 60 "..."}}</a>
					<span class="info">at <abbr class="timeago" title="{{.Ctime}}"></abbr></span>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
		<div class="sep20"></div>
		<div class="box_white recent recent-projects">
			<div>
				<div class="pull-right title"><a href="/user/{{.user.Username}}/projects">更多>></a></div><h2 class="title">最近发布的项目</h2>
			</div>
			<ul class="list-unstyled">
				{{range .projects}}
				<li>
					<a href="/p/{{if .Uri}}{{.Uri}}{{else}}{{.Id}}{{end}}" title="{{.Name}}">{{.Category}} {{.Name}}</a>
					<span class="info">at <abbr class="timeago" title="{{.Ctime}}"></abbr></span>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
		<div class="sep20"></div>
		<div class="box_white recent recent-comments">
			<div>
				<div class="pull-right title"><a href="/user/{{.user.Username}}/comments">更多>></a></div>
			</div>
			<h2 class="title">最近的评论</h2>
			<ul class="list-unstyled">
				{{range .comments}}
				<li>
					<div class="objinfo">
						<span class="info"><abbr class="timeago" title="{{.Ctime}}"></abbr> 评论了<strong>{{.Objinfo.type_name}}</strong></span>
						<a href="{{.Objinfo.uri}}{{.Objid}}" title="{{.Objinfo.title}}">{{substring .Objinfo.title 60 "..."}}</a>
					</div>
					<div class="content">{{noescape .Content}}</div>
				</li>
				{{else}}
				<p class="no-record text-center">暂无</p>
				{{end}}
			</ul>
		</div>
	</div>
	<div class="col-lg-3 col-md-4 col-sm-5">
		<div class="row box_white sidebar">
			<div class="top">
				<ul class="list-inline text-center">
					<li class="first"><a href="/topics" target="_blank" class="cur" title="点击更多">最新主题</a>|</li>
					<li class="second"><a href="/resources" target="_blank" title="点击更多">最新资源</a>|</li>
					<li class="last"><a href="javascript:;">最新评论</a></li>
				</ul>
				<p class="bar"></p>
			</div>
			<div class="sb-content">
				<div class="topic-list first">
					<ul class="list-unstyled">
						<img src="/static/img/loaders/loader7.gif" alt="加载中" />
					</ul>
				</div>
				<div class="resource-list second hidden">
					<ul class="list-unstyled">
					</ul>
				</div>
				<div class="cmt-list last hidden">
					<ul class="list-unstyled">
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
{{end}}
{{define "css"}}
<style>
.pull-right a.btn-success {
	border-radius: 0px;
	width: auto;
}
</style>
{{end}}
{{define "js"}}
<script type="text/javascript">
// 需要加载的侧边栏
SG.SIDE_BARS = [
	"/topics/recent",
	"/resources/recent",
	"/comments/recent",
];
</script>
{{end}}
